﻿#pragma execution_character_set("utf-8")
#include "Secretary.h"
#include "StockObserver.h"
#include "NBAObserver.h"
#include "Boss.h"

using namespace std;

int main(int argc, char *argv[])
{
    //老板胡汉三
    auto huhansan = shared_ptr<Boss>(new Boss());

    //看股票的同事
    auto tongshi1 = shared_ptr<StockObserver>(new StockObserver("魏关姹", huhansan));
    //看NBA的同事
    auto tongshi2 = shared_ptr<NBAObserver>(new NBAObserver("易管查", huhansan));

    huhansan->Attach(tongshi1);
    huhansan->Attach(tongshi2);

    huhansan->Detach(tongshi1);

    //老板回来
    huhansan->setAction("我胡汉三回来了！");
    //发出通知
    huhansan->Notify();

    return 0;
}
